package com.lg.controller;

import com.lg.rocketmq.config.MQProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 **/
@RestController
public class DemoController {
    @Autowired
    MQProducer producer;

    @GetMapping("/hello")
    public void sendMQ() {
        try {
            producer.sendMessageInTransaction("TopicTest", "Hello", "Hello World", System.currentTimeMillis() + "");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
